Fix a small bug about HVM_MAX_VCPUS related array
authorKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Feb 2010 08:15:08 +0000 (08:15 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Mon, 15 Feb 2010 08:15:08 +0000 (08:15 +0000)
Currently it doesn't block running, anyway, it better fix the small
bug considering if in the future HVM_MAX_VCPUS will not necessarily be
8x value.

Signed-off-by: Liu, Jinsong <jinsong.liu@intel.com>=
tools/python/xen/lowlevel/xc/xc.c
xen/include/public/hvm/hvm_info_table.h

index 1932758090b68f3dfa046b056b9341532fdf4bb6..8ed1053575b1448b6fa5f8567b4a2f1ef1bda6a4 100644 (file)
@@ -916,7 +916,7 @@ static PyObject *pyxc_hvm_build(XcObject *self,
     char *image;
     int memsize, target=-1, vcpus = 1, acpi = 0, apic = 1;
     PyObject *vcpu_avail_handle = NULL;
-    uint8_t vcpu_avail[HVM_MAX_VCPUS/8];
+    uint8_t vcpu_avail[(HVM_MAX_VCPUS + 7)/8];
 
     static char *kwd_list[] = { "domid",
                                 "memsize", "image", "target", "vcpus", 
index adb3fb9041ce11e419285410c67c1b9fefdd0da8..bdb5995e716b6cadec548e7e7932b3fe7c08ce54 100644 (file)
@@ -69,7 +69,7 @@ struct hvm_info_table {
     uint32_t    high_mem_pgend;
 
     /* Bitmap of which CPUs are online at boot time. */
-    uint8_t     vcpu_online[HVM_MAX_VCPUS/8];
+    uint8_t     vcpu_online[(HVM_MAX_VCPUS + 7)/8];
 };
 
 #endif /* __XEN_PUBLIC_HVM_HVM_INFO_TABLE_H__ */